<?php

namespace app\index\controller;

use think\Request;
use think\Db;

class Comment extends Common 
{
	public function add() {
		// uid gid content level 图片？文件上传
	}

	public function get() {
		$gid  = input('post.gid');
		$page = input('post.page');
		$row  = input('post.row');

		$page -= 1;

		$res = DB::name('comment')
			->where('gid', $gid)
			->limit($page, $row)
			->order('createtime desc')
			->select();
		return $this->success($res);
	}

	public function reply() {
		$id  = input('post.id'); //评论id
		$gid = input('post.gid');
		$uid = input('post.uid');
	}
}
